Integrand size = 28, antiderivative size = 119 \[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 c^2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}-\frac {4 \sqrt {2} c^2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}+\frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}} \]
[Out]
Time = 0.22 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3989, 3972, 490, 536, 209} \[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 c^2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {4 \sqrt {2} c^2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {a} f}+\frac {2 c^2 \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \]
[In]
[Out]
Rule 209
Rule 490
Rule 536
Rule 3972
Rule 3989
Rubi steps \begin{align*} \text {integral}& = \left (a^2 c^2\right ) \int \frac {\tan ^4(e+f x)}{(a+a \sec (e+f x))^{5/2}} \, dx \\ & = -\frac {\left (2 a^2 c^2\right ) \text {Subst}\left (\int \frac {x^4}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f} \\ & = \frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {\left (2 c^2\right ) \text {Subst}\left (\int \frac {2+3 a x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f} \\ & = \frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {\left (2 c^2\right ) \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}+\frac {\left (8 c^2\right ) \text {Subst}\left (\int \frac {1}{2+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f} \\ & = \frac {2 c^2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}-\frac {4 \sqrt {2} c^2 \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}+\frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}} \\ \end{align*}
Time = 0.68 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.84 \[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 c^2 \left (\text {arctanh}\left (\sqrt {1-\sec (e+f x)}\right )-2 \sqrt {2} \text {arctanh}\left (\frac {\sqrt {1-\sec (e+f x)}}{\sqrt {2}}\right )+\sqrt {1-\sec (e+f x)}\right ) \tan (e+f x)}{f \sqrt {1-\sec (e+f x)} \sqrt {a (1+\sec (e+f x))}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(324\) vs. \(2(102)=204\).
Time = 5.18 (sec) , antiderivative size = 325, normalized size of antiderivative = 2.73
method | result | size |
default | \(-\frac {2 c^{2} \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (2 \sqrt {2}\, \cos \left (f x +e \right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}+2 \sqrt {2}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )-\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \cos \left (f x +e \right )-\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\sin \left (f x +e \right )\right )}{f a \left (\cos \left (f x +e \right )+1\right )}\) | \(325\) |
parts | \(-\frac {c^{2} \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \left (\sqrt {2}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )-2 \,\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )\right )}{f a}-\frac {c^{2} \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (\sqrt {2}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )+2 \cot \left (f x +e \right )-2 \csc \left (f x +e \right )\right )}{f a}-\frac {2 c^{2} \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {2}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right ) \sqrt {a \left (\sec \left (f x +e \right )+1\right )}}{f a}\) | \(350\) |
[In]
[Out]
none
Time = 0.38 (sec) , antiderivative size = 438, normalized size of antiderivative = 3.68 \[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=\left [\frac {2 \, c^{2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) + 2 \, \sqrt {2} {\left (a c^{2} \cos \left (f x + e\right ) + a c^{2}\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{a}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) - {\left (c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right )}{a f \cos \left (f x + e\right ) + a f}, \frac {2 \, {\left (c^{2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) - {\left (c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + \frac {2 \, \sqrt {2} {\left (a c^{2} \cos \left (f x + e\right ) + a c^{2}\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right )}{\sqrt {a}}\right )}}{a f \cos \left (f x + e\right ) + a f}\right ] \]
[In]
[Out]
\[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=c^{2} \left (\int \left (- \frac {2 \sec {\left (e + f x \right )}}{\sqrt {a \sec {\left (e + f x \right )} + a}}\right )\, dx + \int \frac {\sec ^{2}{\left (e + f x \right )}}{\sqrt {a \sec {\left (e + f x \right )} + a}}\, dx + \int \frac {1}{\sqrt {a \sec {\left (e + f x \right )} + a}}\, dx\right ) \]
[In]
[Out]
\[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=\int { \frac {{\left (c \sec \left (f x + e\right ) - c\right )}^{2}}{\sqrt {a \sec \left (f x + e\right ) + a}} \,d x } \]
[In]
[Out]
Exception generated. \[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx=\int \frac {{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^2}{\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}} \,d x \]
[In]
[Out]